<template>
	<view class="">
		<view class="box" v-for="(item,index) in remarkarr" :key="index">
			<view class="hr" v-if="flag">
			</view>
			<view class="userinfo">
				<image :src="item.user.head_img" mode=""></image>
				<text>{{item.user.name}}</text>
			</view>
			<view class="remark">
				{{item.content}}
			</view>

			<view class="imgbox">
				<image :src="v" mode="" @click="lookimg(item.imgs)" v-for="(v,i) in item.imgs" :key="i"></image>
			</view>
			<view class="time">
				{{item.user.create_time}}
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		props: {
			remarkarr: {
				type: Array,
				default: []
			},
			flag:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return {}
		},
		methods: {
			lookimg(v) {
				uni.previewImage({
					urls: v,
					longPressActions: {
						itemList: ['发送给朋友', '保存图片', '收藏'],
						success: function(data) {
							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
						},
						fail: function(err) {
							debugger
							console.log(err.errMsg);
						}
					}
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.box {
		padding: 20rpx;
		box-sizing: border-box;
		.hr{
			width: 100%;
			height: 15rpx;
			background-color: #EDEDED;
		}

		.userinfo {
			display: flex;
			align-items: center;

			image {
				width: 50rpx;
				height: 50rpx;
				border-radius: 50rpx;
			}

			text {
				color: #000000;
				font-size: 28rpx;
				margin-left: 20rpx;
			}
		}

		.remark {
			font-size: 26rpx;
			color: #000000;
			margin-top: 30rpx;
		}

		.imgbox {
			display: flex;
			overflow-y: hidden;
			white-space: nowrap;
			width: 500px;
			overflow-x: scroll;
			margin-top: 20rpx;

			&::-webkit-scrollba {
				display: none;
			}

			image {
				width: 200rpx;
				height: 200rpx;
				margin-right: 10rpx;
				margin-bottom: 10rpx;
			}
		}

		.time {
			font-family: MicrosoftYaHei;
			font-size: 20rpx;
			color: #828282;
		}
	}
</style>
